package kibahed.interfaces;

import java.io.IOException;
import java.io.PrintWriter;
import java.net.Socket;

public class ClientRepresentation {

	Socket socket;
	PrintWriter outputStream;
	String name = "anonym";
	
	public ClientRepresentation() {
		
	}
	
	public ClientRepresentation(Socket socket){
		this.socket=socket;
		
		try {
			PrintWriter outputStream = new PrintWriter(socket.getOutputStream(), true);
			this.outputStream = outputStream;
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public void sendMessageToClient(String msg){
		if(outputStream!=null){
			outputStream.println(msg);
		}
	}
	
	public void setName(String name){
		this.name=name;
	}
	
	public String getName(){
		return name;
	}
}
